@RestResource(urlMapping = '/test/*')
global with sharing class JohnTestRestApi {
    @HttpGet
    global static void click() {
        RestRequest req = RestContext.request;
        System.debug(req.requestURI);
        String id = req.requestURI.substring(req.requestURI.lastIndexOf('/') + 1);
        String callback = req.params.get('callback');

        String msg = 'id: ' + id + ', callback: ' + callback;

        RestResponse resp = RestContext.response;
        resp.statusCode = 200;
        resp.responseBody = Blob.valueOf(msg);
    }
}